package com.yo.example.consumer;

import com.yo.example.common.model.User;
import com.yo.example.common.service.UserService;
import com.yo.yorpc.proxy.ServiceProxyFactory;

/**
 * 简易服务消费者实例
 */
public class EasyConsumerExample {
    public static void main(String[] args) {
        //todo 需要获取UserService的实现类对象
        UserService userService= ServiceProxyFactory.getProxy(UserService.class);
        User user=new User();
        user.setName("Yo");
        User newUser=userService.getUser(user);
        if (newUser!=null) System.out.println(newUser.getName());
        else System.out.println("user is null");
    }
}
